package cn.jiyun.controller;

import cn.jiyun.pojo.User;
import cn.jiyun.service.Uservice;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private Uservice uservice;

    @GetMapping("{id}")
    public User all(@PathVariable Integer id,@RequestHeader(required = false) String Truth){
        System.out.println(Truth);
        return uservice.all(id);
    }

    @GetMapping("all")
    public List<User> allqc(){
        return uservice.allqc();
    }

    @GetMapping("del")
    public void del(Long id){
         uservice.del(id);
    }

}
